<?php
/**
 * @author ykm 2016/5/17
 * @describe 添加商家备注 数据保存
 */

class erpapi_shop_response_process_remark {
    
    public function add($params) {
        $remark = $params['mark_text'];
        $remark[] = $params['new_mark'];
        app::get('ome')->model('orders')->update(array('mark_text'=>serialize($remark)),array('order_id'=>$params['order_id']));
        $orderPauseAllow = app::get('ome')->getConf('ome.orderpause.to.syncmarktext');#同步订单备注是否暂停订单配置
        #备注发生变更，已审核订单暂停
        if (in_array($params['process_status'], array('splited', 'splitting')) && $orderPauseAllow == 'true') {
            app::get('ome')->model('orders')->pauseOrder($params['order_id']);
        }
        $memo ='更新商家备注';
        app::get('ome')->model('operation_log')->write_log('order_edit@ome',$params['order_id'],$memo);
        return array('rsp'=>'succ', 'msg'=>'更新商家备注成功');
    }
}